# Lets check only possible case:
#   1digit * 4digit = 4 digit
#   2digit * 3digit = 4 digit
#
# Get all the permutation of [1, 2, 3, ..., 9]
# Check possible a * b = p possibility

import itertools


def Solve():
    prod = []
    for perm in itertools.permutations('123456789'):
        digit = ''.join(perm)
        for p in [1, 2]:
            a = int(digit[0:p])
            b = int(digit[p:5])
            p = int(digit[5:9])

            if a * b == p:
                prod.append(p)
    return sum(set(prod))
